<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml"> 
 
<head> 
	<meta http-equiv="Content-type" content="text/html; charset=utf-8" /> 
	<title>湖南省自来水公司营销管理信息系统</title> 
	
	<link rel="stylesheet" href="../css/reset.css" type="text/css" media="screen" title="no title" />
	<link rel="stylesheet" href="../css/text.css" type="text/css" media="screen" title="no title" />
	<link rel="stylesheet" href="../css/form.css" type="text/css" media="screen" title="no title" />
	<link rel="stylesheet" href="../css/buttons.css" type="text/css" media="screen" title="no title" />
	<link rel="stylesheet" href="../css/grid.css" type="text/css" media="screen" title="no title" />	
	<link rel="stylesheet" href="../css/layout.css" type="text/css" media="screen" title="no title" />	
	
	<link rel="stylesheet" href="../css/ui-darkness/jquery-ui-1.8.12.custom.css" type="text/css" media="screen" title="no title" />
	<link rel="stylesheet" href="../css/plugin/jquery.visualize.css" type="text/css" media="screen" title="no title" />
	<link rel="stylesheet" href="../css/plugin/facebox.css" type="text/css" media="screen" title="no title" />
	<link rel="stylesheet" href="../css/plugin/uniform.default.css" type="text/css" media="screen" title="no title" />
	<link rel="stylesheet" href="../css/plugin/dataTables.css" type="text/css" media="screen" title="no title" />
	
	<link rel="stylesheet" href="../css/custom.css" type="text/css" media="screen" title="no title">
	<script src="../js/jquery/jquery-3.3.1.js"></script>
	<script src="/webjars/vue/2.5.17/dist/vue.js"></script>
	<script src="../layui/layui.all.js" type="text/javascript" ></script>
	<style type="text/css">
	table.data thead th { vertical-align:middle; text-align:center; }
	.re { width:60px; text-align:center; }
	</style>
	<script>
		var url =  new URLSearchParams(location.search);
		$(function(){
			var id=url.get("id");
			content.volumeId=id;
			$.getJSON("/rd-read/queryAuditByID",{"volumeId":id},function(json){
				content.read=json;
			})
		});
	</script>
</head> 
 
<body> 

<div id="wrapper">

	<div id="bool"><script>window.onload=function (){  $("#bool").load("../ming.html");}</script></div>


	<div id="content" class="xgrid">

		<div class="x12">
			
			<h2>
				抄表复核 - 按表册复核 - 城东#1
				<div style="float:right;">
					按表册复核
					<a href="rd_auditUser.html">按用户复核</a>
				</div>
			</h2>

			<div style="float:left;">
				<button class="btn-icon btn-grey btn-back" onClick="location='/page/rd_audit.html'"><span></span>返回</button>
			</div>
			<div style="float:right;">
				<button class="btn-icon btn-blue btn-check" @Click="show1();"><span></span>复核选中的所有记录</button>
			</div>
			<br/><br/>
			<script>

				function checkAll() {
					content.checkbox=[];
					var all=document.getElementById('all');//获取到点击全选的那个复选框的id
					var one=document.getElementsByName('checkname[]');//获取到复选框的名称
					if(all.checked==true){//因为获得的是数组，所以要循环 为每一个checked赋值
						for(var i=0;i<one.length;i++){
							one[i].checked=true;
							content.checkbox.push(one[i].value);
						}
					}else{
						for(var j=0;j<one.length;j++){
							one[j].checked=false;
							content.checkbox=[];
						}

					}

				}

			</script>

			<table class="data display">
					<thead>
						<tr>
							<th><input type="checkbox" id="all" onClick="checkAll();"></th>
							<th>年份</th>
							<th>月份</th>
							<th>第几次<br/>抄表</th>
							<th>用户编码</th>
							<th>用户姓名</th>
							<th>上次底码</th>
							<th>本次底码</th>
							<th>用水量</th>
							<th>性质</th>
							<th>&nbsp;</th>
						</tr>
					</thead>
					<tbody ref="table">
						<tr class="odd" v-for="r in read">
							<td class="center"><input type="checkbox" name="checkname[]" :value="r.ID" class="chk" v-model="checkbox"></td>
							<td class="center" v-text="r.ReadYear">加载中...</td>
							<td class="center" v-text="r.ReadMonth">加载中...</td>
							<td class="center" >1</td>
							<td class="center" v-text="r.UserNo">加载中...</td>
							<td class="center" v-text="r.UserName">加载中...</td>
							<td class="right" v-text="r.PreValue">加载中...</td>
							<td class="right" v-text="r.CurValue">加载中...</td>
							<td class="right" v-text="r.Amount">加载中...</td>
							<td class="center">每月抄表任务</td>
							<td class="center">
								<button class="btn-icon btn-small btn-blue btn-check" @Click="show2(r.ID);"><span></span>复核</button>
							</td>
						</tr>
						</tbody>
					</table>
		</div> <!-- .x12 -->
	</div> <!-- #content -->
	<script>
		var content=new Vue({
			el:"#content",
			data:{
				volumeId:"",
				read:"",
				checkbox:[],
				id:"",
			},
			methods:{
				show1(){
					var value=1;
					var w = ($(window).width() * 0.7);
					var h = ($(window).height() - 50);
					var str="";
					layer.open({
						resize: false,
						title: '预览',
						shadeClose: true,
						area: [w + 'px', h + 'px'],
						type: 2,
						content: 'rd_audit_progress.html?length='+content.checkbox.length,
						btn: ['关闭'],
						// yes: function (index, obj) {
						// 	///当点击‘确定’按钮的时候，获取弹出层返回的值
						// 	var res = window["layui-layer-iframe" + index].show();
						// 	//打印返回的值，看是否有我们想返回的值。
						// 	alert(res);
						// 	//     console.log(res);
						// 	//最后关闭弹出层
						// 	layer.close(index);
						// },
						success: function (layero, index) {
							var body = layer.getChildFrame('body', index);
							str = body.find('button').html();
						}
					});

				},
				show2(id) {
					content.id=id;
					var value = 1;
					var w = ($(window).width() * 0.7);
					var h = ($(window).height() - 50);
					var str = "";
					layer.open({
						resize: false,
						title: '预览',
						shadeClose: true,
						area: [w + 'px', h + 'px'],
						type: 2,
						content: 'rd_audit_progress1.html',
						btn: ['关闭'],
						// yes: function (index, obj) {
						// 	///当点击‘确定’按钮的时候，获取弹出层返回的值
						// 	var res = window["layui-layer-iframe" + index].show();
						// 	//打印返回的值，看是否有我们想返回的值。
						// 	alert(res);
						// 	//     console.log(res);
						// 	//最后关闭弹出层
						// 	layer.close(index);
						// },
						success: function (layero, index) {
							var body = layer.getChildFrame('body', index);
							str = body.find('button').html();
						}
					});
				},
				addPy(){
					$.post("/rd-read/addpy",{"Id":content.checkbox.toString(),"volumeId":content.volumeId},function (date) {
					content.read=date;
					})
				},
				addPyById(){
					$.post("/rd-read/addpy",{"Id":content.id.toString(),"volumeId":content.volumeId},function (date) {
						content.read=date;
					})
				}
			}
			// created(){
			//
			// }
		})
	</script>
	<div id="footer">		
		<div class="content_pad">			
			<p>&copy; 2013-11 版权所有 <a href="#">湖南省自来水公司</a>.   技术支持 <a href="#">职业教育</a>.</p>
		</div> <!-- .content_pad -->
	</div> <!-- #footer -->
	
</div> <!-- #wrapper -->

<script src="../js/jquery/jquery-1.5.2.min.js"></script>
<script src="../js/jquery/jquery-ui-1.8.12.custom.min.js"></script>
<script src="../js/misc/excanvas.min.js"></script>
<script src="../js/jquery/facebox.js"></script>
<script src="../js/jquery/jquery.visualize.js"></script>
<script src="../js/jquery/jquery.dataTables.min.js"></script>
<script src="../js/jquery/jquery.tablesorter.min.js"></script>
<script src="../js/jquery/jquery.uniform.min.js"></script>
<script src="../js/jquery/jquery.placeholder.min.js"></script>

<script src="../js/widgets.js"></script>
<script src="../js/dashboard.js"></script>

<script type="text/javascript">
	
$(document).ready ( function () 
{
	Dashboard.init ();
	
});

//审核操作
function auditMutil(){
	showWindow({url:'../page/rd_audit_progress.html',width:560,height:240});
}
function audit(){
	showWindow({url:'../page/rd_audit_progress1.html',width:560,height:240});
}

</script>

</body> 
 
</html>